package com.sen.dto;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 视频类
 */
public class Video {

    private int id;
    private String bv;// 视频号
    private String title;// 标题
    private LocalDateTime publishTime;// 发布时间
    private String cover;// 封面
    private String introduction;// 简介
    private List<String> tagList;// 标签

    private String tags;// 标签 在getTagList() 转 tagList
    private List<Part> partList;// part
    private String type;// 类型: 自制,转载
    private String category;// 分区:生活,游戏,动漫

    public Video() {
    }

    public Video(int id, String bv, String title, LocalDateTime publishTime, String cover, String introduction, List<String> tagList, String tags, List<Part> partList, String type, String category) {
        this.id = id;
        this.bv = bv;
        this.title = title;
        this.publishTime = publishTime;
        this.cover = cover;
        this.introduction = introduction;
        this.tagList = tagList;
        this.tags = tags;
        this.partList = partList;
        this.type = type;
        this.category = category;
    }

    @Override
    public String toString() {
        return "Video{" +
                "id=" + id +
                ", bv='" + bv + '\'' +
                ", title='" + title + '\'' +
                ", publishTime=" + publishTime +
                ", cover='" + cover + '\'' +
                ", introduction='" + introduction + '\'' +
                ", tagList=" + getTagList() +
                ", tags='" + tags + '\'' +
                ", partList=" + partList +
                ", type='" + type + '\'' +
                ", category='" + category + '\'' +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getBv() {
        return bv;
    }

    public void setBv(String bv) {
        this.bv = bv;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public LocalDateTime getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(LocalDateTime publishTime) {
        this.publishTime = publishTime;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public List<String> getTagList() {
        String tags=this.tags;// java_c++_面试_求职_计算机技术
        if (tags == null){
            return List.of();
        }
        String[] s = tags.split("_");
        return List.of(s);//数组转List
    }

    public void setTagList(List<String> tagList) {
        this.tagList = tagList;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public List<Part> getPartList() {
        return partList;
    }

    public void setPartList(List<Part> partList) {
        this.partList = partList;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }
}
